% 文件读取
[~,~,imgs]=xlsread('2021MCM_ProblemC_ Images_by_GlobalID.xlsx');
[~,~,details]=xlsread('2021MCMProblemC_DataSet.xlsx');

%%
usedforp{1,1}='GlobalID';
usedforp{1,2}='Lab Status';
usedforp{1,3}='FileName';
% 将图片表格里面id摘出来
imgsid=imgs(:,2);
imgname=imgs(:,1);
% 新表的索引
k=2;
unknow=[];
for i=2:4441
    item=details{i,1};
    index=find(strcmp(imgsid,item));
    if length(index)==0
        unknow=[unknow,i];
        usedforp{k,1}=details{i,1};
        usedforp{k,2}=details{i,4};
        k=k+1;
        continue;
    end
    indexl=length(index);
    for j=1:indexl
        usedforp{k,1}=imgsid{index(j),1};
        usedforp{k,2}=details{i,4};
        usedforp{k,3}=imgname{index(j),1};
        k=k+1;
    end
end

%%
% 存入表格
xlswrite('yongyutupianchuli.xlsx',usedforp,1);
